Skip to content

feat: enable debug-embed on rust-embed for dev-mode builds#25

Open
ecalifornica wants to merge 1 commit intoempathic:mainfrom
ecalifornica:ecalifornica/embed-debug
Open

feat: enable debug-embed on rust-embed for dev-mode builds#25
ecalifornica wants to merge 1 commit intoempathic:mainfrom
ecalifornica:ecalifornica/embed-debug

Conversation

@ecalifornica
Copy link
Copy Markdown

Enables the debug-embed feature on rust-embed so the embedded-ui crate bakes the SvelteKit bundle into the binary in all build modes, not just release.

rust-embed defaults to reading files from disk at runtime in debug builds and only embeds in release. That means cargo build -p workshop --features embedded-ui and fastbuild Bazel images produce binaries whose UI assets point at compile-time paths that don't exist at runtime in the container. debug-embed forces embedding regardless of build mode.

fastbuild opt
without debug-embed image broken (UI 404) image works
with debug-embed (this PR) image works, unoptimized image works

Tradeoff

If you edit SvelteKit source while rebuilding an embedded-ui binary in fastbuild, rust-embed re-runs and workshop_ui_crate recompiles. The UI dev loop (pnpm dev + non-embedded-ui binary) isn't affected.

rust-embed reads files from disk at runtime in debug builds and only embeds in release.
`cargo build -p workshop --features embedded-ui` and fastbuild Bazel images both produce binaries that can't find the embedded paths at runtime.
debug-embed forces embedding in every mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant